package cn.itsy.pojo;

import java.util.List;

public class Page {

    private Integer currentPage;// 当前页，要查看的页数
    private Integer pageSize;// 每页显示多少行
    private Integer totalCount;// 总行数
    private Integer totalPage;// 总页数

    private List pl;// 查询的数据limit start,end;

    public Integer getCurrentPage() {
        if (currentPage <= 1) {
            currentPage = 1;
        } else if (currentPage >= totalPage) {
            currentPage = totalPage;
        }
        return currentPage;
    }

    public void setCurrentPage(Integer currentPage) {
        this.currentPage = currentPage;
    }

    public Integer getPageSize() {
        return pageSize;
    }

    public void setPageSize(Integer pageSize) {
        this.pageSize = pageSize;
    }

    public Integer getTotalCount() {
        return totalCount;
    }

    public void setTotalCount(Integer totalCount) {
        this.totalCount = totalCount;
    }

    public Integer getTotalPage() {
        return totalPage;
    }

    public void setTotalPage(Integer totalPage) {
        this.totalPage = totalPage;
    }

    public List getPl() {
        return pl;
    }

    public void setPl(List pl) {
        this.pl = pl;
    }

    @Override
    public String toString() {
        return "Page{" +
                "currentPage=" + currentPage +
                ", pageSize=" + pageSize +
                ", totalCount=" + totalCount +
                ", totalPage=" + totalPage +
                ", pl=" + pl +
                '}';
    }
}
